package com.carb.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.carb.enums.ItemOperationType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 物品库存记录实体类
 * </p>
 *
 * @author XuChaoyang
 * @since 2025-02-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_item_stock_record")
@Schema(description = "物品库存记录表")
public class ItemStockRecord implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "物品库存记录id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "物品id")
    private Long itemId;

    @Schema(description = "操作类型 (出库, 入库)")
    private ItemOperationType operationType;

    @Schema(description = "数量")
    private Integer quantity;

    @Schema(description = "备注")
    private String note;

    @Schema(description = "操作人用户id")
    private Long operatorUserId;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
